/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.loja.model.entity.transacao;

import javax.persistence.CascadeType;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import br.com.loja.model.entity.venda.Venda;

/**
 *
 * @author David Luiz
 */
@MappedSuperclass
public abstract class PagamentoVenda extends Credito {

    @ManyToOne(cascade = CascadeType.ALL)
    private Venda venda;

    public PagamentoVenda() {
        super();
    }

    protected PagamentoVenda(Venda venda) {
        super();

        if (venda == null) {
            throw new IllegalArgumentException("Venda Invalida");
        }

        this.venda = venda;
    }

    /**
     * @return the venda
     */
    public Venda getVenda() {
        return venda;
    }

    /**
     * @param venda the venda to set
     */
    public void setVenda(Venda venda) {
        this.venda = venda;
    }

}
